<template>
	<view class="content">
		<view class="fel">
			<view class="wit" @tap="menuinfo(item.id)" v-for="item in menus" :key='item.id'>
				<image :src="item.image" mode=''></image>
				<view class="webz">
					<text>{{item.name}}</text>
					<view class="xi">
						<!-- 	<image src="../../static/images/s25.png" mode="widthFix"></image>	
	<text>450</text> -->
					</view>
				</view>
			</view>

		</view>




	</view>
</template>

<script>
	export default {
		data() {
			return {
				menus: [],
				courrt: 1,
				bs: 1,
			}
		},
		onLoad() {
			this.nu()
		},
		onReachBottom() {
			if (this.bs) {
				this.$ajax(
					this.apiList.menu, {
						page: ++this.courrt
					},
					'POST',
				).then(res => {
					this.menus = this.menus.concat(res.data)
					if (!res.data.length) {
						this.bs = 0;
						this.$sToast('无更多数据')
					};
				})
			}
		},
		methods: {
			menuinfo(id) {
				uni.navigateTo({
					url: 'menuinfo/menuinfo?id=' + id
				})
			},
			nu() {
				this.$ajax(
					this.apiList.menu, {
						page: 1
					},
					'POST',
				).then(res => {
					this.menus = res.data
				})
			},
		},

	}
</script>

<style lang="scss" scoped>
	.content {
		.fel {
			width: 100%;
			box-sizing: border-box;
			padding:  30upx 0;
			display: flex;
			flex-wrap: wrap;
			justify-content: space-around;

			.wit {
				width: 45%;
				margin-bottom: 20upx;
				border: 1rpx solid #ccc;
				box-sizing: border-box;
				image {
					width: 100%;
					height: 320upx;
				}

				.webz {
					width: 100%;
					box-sizing: border-box;
					text {
						display: inline-block;
						overflow: hidden;
						flex-wrap: nowrap;
						text-overflow: ellipsis;
						white-space: nowrap;
						width: 90%;
						font-size: 30upx;
						margin-left: 20upx;
					}
				}
			}
		}
	}
</style>
